﻿@model MyValuableCalculator.ViewModels.HomeIndexViewModel

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
@using (Html.BeginForm())
{
    @Html.ValidationSummary("The calculation failed. Please correct the errors and try again")
    @Html.EditorFor(m => m.ElementaryMath.Op1)
    @Html.DropDownListFor(m => m.ElementaryMath.ArithmeticOperation, Model.ArithmeticOperations);
    @Html.EditorFor(m => m.ElementaryMath.Op2)
    <input type="submit" value="=" />
    @Html.DisplayTextFor(m => m.ElementaryMath.Result)
}

<!--Sätte fokus på det första inputfältet-->
<script type="text/javascript">
    $(function(){
        $("#ElementaryMath_Op1").focus();
    });
</script>